package com.gzq.builder.example1;

import java.util.ArrayList;

public class Director {
    private ArrayList<String> sequence = new ArrayList<>();
    private BuilderBenz benzBuilder = new BuilderBenz();
    private BuilderBMW bmwBuilder = new BuilderBMW();

    public ProductBMW getABMWModel(){
        this.sequence.clear();
        this.sequence.add("start");
        this.sequence.add("stop");
        bmwBuilder.setSequence(this.sequence);
        return (ProductBMW) bmwBuilder.getCarModel();
    }

    public ProductBMW getBBMWModel(){
        this.sequence.clear();
        this.sequence.add("start");
        this.sequence.add("engine boom");
        this.sequence.add("stop");
        bmwBuilder.setSequence(this.sequence);
        return (ProductBMW) bmwBuilder.getCarModel();
    }

    public ProductBenz getABenzModel(){
        this.sequence.clear();
        this.sequence.add("start");
        this.sequence.add("stop");
        this.benzBuilder.setSequence(this.sequence);
        return (ProductBenz) this.benzBuilder.getCarModel();
    }

    public ProductBenz getBBenzModel(){
        this.sequence.clear();
        this.sequence.add("alarm");
        this.sequence.add("start");
        this.sequence.add("stop");
        this.benzBuilder.setSequence(this.sequence);
        return (ProductBenz) this.benzBuilder.getCarModel();
    }

}
